/**
* Audio Helper files for SwakSmack Firefox Extension
* Author: clearcache@gmail.com (aka filet0fish)
*/

const AUDIO_DIR = "chrome://swaksmack/skin/";
const DEFAULT_SOUND = "swak1.wav";
//const GURU_SOUND = "question.wav";

var sound = Components.classes["@mozilla.org/sound;1"].createInstance(Components.interfaces.nsISound);
var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);

function playAudioAlert(audioFile){
	try {
		var url = ioService.newURI(AUDIO_DIR + audioFile, null, null);
		sound.play(url);
	} catch(ex) {
		alert("Playing sound failed...");
	}
}

